class AuthClass:
    def __init__(self, name, pwd):
        self.name = name
        self.pwd = pwd

    def auth(self):
        if self.name == "Python" and self.pwd == "123456":
            return True
        else:
            return False


user1 = AuthClass("Python", "123456")
user2 = AuthClass("python", "123")
print(user1.auth(), user2.auth())

from functools import wraps


def auth_before(func):
    @wraps(func)
    def inner(*args, **kwargs):
        if not user2.auth():
            print("用户名或密码错误")
            return False
        else:
            return func(*args, **kwargs)

    return inner


@auth_before
def func1():
    return "this is func1 function..."


if __name__ == '__main__':
    print(func1())
